import 'dart:io';

import 'package:flutter/cupertino.dart';

class MyWillPopScope extends StatelessWidget {
  final Widget child;
  final PopInvokedCallback? onWillPop;

  const MyWillPopScope({super.key, required this.child, this.onWillPop});

  @override
  Widget build(BuildContext context) {
    return Platform.isAndroid
        ? PopScope(canPop: false, onPopInvoked: onWillPop, child: child)
        : child;
  }
}
